/*
 * main.cpp
 *
 *  Created on: 12 mars 2012
 *      Author: lsinapayen
 */

using namespace std;
#include <vector>
#include <string>
#include "XMLArbre.h"
#include "EmptyElement.h"
#include "ContentElement.h"
#include "Element.h"
#include "Item.h"
#include "Attribut.h"
#include "Data.h"

//TODO enlever items dans arbrexml.h
//TODO visio

int main ()
{
	printf("main:- main\n");

	XMLArbre arbre;
	string xml; //memo
	string eeName;
	string eeNsp;
	vector<Item*> its;
	Attribut * a1;
	string a1N;
	string a1V;
	vector<Attribut*> atts;
	Data * d;
	string data;
	Element * racine;



	xml = "<br/> <a xy=\"10\">blabla</a> "; //memo
	eeName = "br";
	eeNsp = "namespace1";
	EmptyElement * ee = new EmptyElement(&eeName,&eeNsp);

	eeName = "a";
	a1N = "xy";
	a1V = "10";
	a1 = new Attribut(&a1N,&a1V);
	atts.push_back(a1);
	data = "balbla";
	d = new Data(&data);
	ContentElement * ce = new ContentElement(&eeName,&eeNsp);
	ce->setAttributs(&atts);
	its.push_back(d);
	ce->setItems(&its);
	its.clear();

	its.push_back(ee);
	its.push_back(ce);
	eeName = "";
	eeNsp = "none";
	racine = new Element(&eeName,&eeNsp);
	racine->setItems(&its);
	arbre.setRacine(racine);

	printf("main:- affichage arbre \n");
	arbre.afficher();

	ee->~Item();
	printf("main:- end \n");
	return 0;
}
